<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // prompt 返回的是字符串 parseInt转换成整数
        var n = parseInt(prompt("请输入数字："))
        switch (n) {
            case 1:
                document.write("今天星期一")
                break
            case 2:
                document.write("今天星期二")
                break
            case 3:
                document.write("今天星期三")
                break
            case 4:
                document.write("今天星期四")
                break
            case 5:
                document.write("今天星期五")
                break
            case 6:
                document.write("今天星期六")
                break
            case 7:
                document.write("今天星期天")
                break
            // 默认值
            default:
                document.write("上帝没有创造星期八")
        }
    </script>
</body>

</html>